using System;
using System.Collections.Generic;
using System.Text;

using System.Collections;
using System.Data;
namespace DeThi1
{
    class clsBaiHat
    {
        private string m_strMaBaiHat;
        private string m_strTenBaiHat;
        private string m_strTacGia;
        private string m_strLoiBaiHat;
        private string m_strMaAlbum;
        private string m_strTenAlbum;

        public string TENALBUM
        {
            get { return m_strTenAlbum; }
            set { m_strTenAlbum = value; }
        }
        public string MABAIHAT
        {
            get { return m_strMaBaiHat; }
            set { m_strMaBaiHat = value; }
        }
        public string TENBAIHAT
        {
            get { return m_strTenBaiHat; }
            set { m_strTenBaiHat = value; }
        }
        public string TACGIA
        {
            get { return m_strTacGia; }
            set { m_strTacGia = value; }
        }
        public string LOIBAIHAT
        {
            get { return m_strLoiBaiHat; }
            set { m_strLoiBaiHat = value; }
        }
        public string MAALBUM
        {
            get { return m_strMaAlbum; }
            set { m_strMaAlbum = value; }
        }

        public clsBaiHat()
        {
            m_strMaBaiHat = "";
            m_strLoiBaiHat = "";
            m_strTacGia = "";
            m_strMaAlbum = "";
            m_strTenBaiHat = "";
            m_strTenAlbum = "";
        }

        static public clsBaiHat TimKiemBaiHat(TruyXuatDuLieu txdl, string MaBaiHat)
        {
            clsBaiHat baihat = new clsBaiHat();
            string strSQL = "SELECT MaBaiHat,TenBaiHat,TacGia,LoiBaiHat,TenAlbum FROM BaiHat,Album WHERE BaiHat.MaAlbum=Album.MaAlbum and BaiHat.MaBaiHat = " + MaBaiHat;
            DataSet dtSet = txdl.TruyVanDuLieu(strSQL, "BaiHat");

            try
            {
                DataTable dtTable = dtSet.Tables["BaiHat"];
                foreach (DataRow dtRow in dtTable.Rows)
                {
                    baihat.TENBAIHAT = dtRow["TenBaiHat"].ToString();
                    baihat.TACGIA = dtRow["TacGia"].ToString();
                    baihat.LOIBAIHAT = dtRow["LoiBaiHat"].ToString();
                    baihat.TENALBUM = dtRow["TenAlbum"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return baihat;
        }
    }
}
